<div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <h5>
                        <span><vc:i18n name="查询条件" namespace="maintainanceTaskManage"></vc:i18n></span>
                    </h5>
                    <div class="ibox-tools" style="top:10px;">
                        <button type="button" class="btn btn-link btn-sm" style="margin-right:10px;"
                                v-on:click="_moreCondition()">
                            {{maintainanceTaskManageInfo.moreCondition == true?'隐藏':'更多'}}
                        </button>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-3">
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('请输入执行人','maintainanceTaskManage')"
                                       v-model="maintainanceTaskManageInfo.conditions.planUserName" class=" form-control">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('请输入实际保养开始时间','maintainanceTaskManage')"
                                       v-model="maintainanceTaskManageInfo.conditions.startTime"
                                       class=" form-control startTime">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('请输入实际保养结束时间','maintainanceTaskManage')"
                                       v-model="maintainanceTaskManageInfo.conditions.endTime"
                                       class=" form-control endTime">
                            </div>
                        </div>
                        <div class="col-sm-2">
                            <button type="button" class="btn btn-primary btn-sm"
                                    v-on:click="_queryMaintainanceTaskMethod()">
                                <i class="fa fa-search"></i>
                                <span><vc:i18n name="查询" namespace="maintainanceTaskManage"></vc:i18n></span>
                            </button>
                            <button type="button" class="btn btn-white btn-sm"
                                    v-on:click="_resetMaintainanceTaskMethod()">
                                <i class="fa fa-repeat"></i>
                                <span><vc:i18n name="重置" namespace="maintainanceTaskManage"></vc:i18n></span>
                            </button>
                        </div>
                    </div>
                    <div class="row" v-show="maintainanceTaskManageInfo.moreCondition == true">
                        <div class="col-sm-3">
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('请输入保养计划ID','maintainanceTaskManage')"
                                       v-model="maintainanceTaskManageInfo.conditions.planId"
                                       class=" form-control">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('请输入保养计划名称','maintainanceTaskManage')"
                                       v-model="maintainanceTaskManageInfo.conditions.planName"
                                       class=" form-control">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <select class="custom-select" v-model="maintainanceTaskManageInfo.conditions.state">
                                <option selected value="">{{vc.i18n('请选择保养状态','maintainanceTaskManage')}}</option>
                                <option v-for="(item,index) in maintainanceTaskManageInfo.stateTypes" :key="index"
                                        :value="item.statusCd">
                                    {{item.name}}
                                </option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>
                        <span><vc:i18n name="保养任务" namespace="maintainanceTaskManage"></vc:i18n></span>
                    </h5>
                    <div class="ibox-tools" style="top:10px;"></div>
                </div>
                <div class="ibox-content">
                    <table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
                        <thead>
                        <tr>
                            <th class="text-center">
                                <span><vc:i18n name="任务编码" namespace="maintainanceTaskManage"></vc:i18n></span>
                            </th>
                            <th class="text-center">
                                <span><vc:i18n name="保养计划" namespace="maintainanceTaskManage"></vc:i18n></span>
                            </th>
                            <th class="text-center">
                                <span><vc:i18n name="保养人" namespace="maintainanceTaskManage"></vc:i18n></span><br/>
                                <span><vc:i18n name="开始/结束时间" namespace="maintainanceTaskManage"></vc:i18n></span>
                            </th>
                            <th class="text-center">
                                <span><vc:i18n name="实际保养时间" namespace="maintainanceTaskManage"></vc:i18n></span>
                            </th>
                            <th class="text-center">
                                <span><vc:i18n name="计划保养人" namespace="maintainanceTaskManage"></vc:i18n></span>
                            </th>
                            <th class="text-center">
                                <span><vc:i18n name="当前保养人" namespace="maintainanceTaskManage"></vc:i18n></span>
                            </th>
                            <th class="text-center">
                                <span><vc:i18n name="转移描述" namespace="maintainanceTaskManage"></vc:i18n></span>
                            </th>
                            <th class="text-center">
                                <span><vc:i18n name="保养状态" namespace="maintainanceTaskManage"></vc:i18n></span>
                            </th>
                            <th class="text-center">
                                <span><vc:i18n name="操作" namespace="maintainanceTaskManage"></vc:i18n></span>
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for="maintainanceTask in maintainanceTaskManageInfo.maintainanceTasks">
                            <td class="text-center">{{maintainanceTask.taskId}}</td>
                            <td class="text-center">{{maintainanceTask.planName}}</td>
                            <td class="text-center">{{maintainanceTask.planInsTime}}<br/>{{maintainanceTask.planEndTime}}
                            </td>
                            <td class="text-center">{{maintainanceTask.actInsTime ? maintainanceTask.actInsTime : '-'}}</td>
                            <td class="text-center">
                                {{maintainanceTask.originalPlanUserName ? maintainanceTask.originalPlanUserName : '-'}}
                            </td>
                            <td class="text-center">{{maintainanceTask.planUserName}}</td>
                            <td class="text-center">
                                {{maintainanceTask.transferDesc ? maintainanceTask.transferDesc : '-'}}
                            </td>
                            <td class="text-center text-danger font-bold" v-if="maintainanceTask.state == '20200408'">
                                {{maintainanceTask.stateName}}
                            </td>
                            <td class="text-center" v-else>{{maintainanceTask.stateName}}</td>
                            <td class="text-center">
                                <div class="btn-group">
                                    <button class="btn-white btn btn-xs"
                                            v-on:click="_openMaintainanceTaskTransfer(maintainanceTask)"
                                            v-if="maintainanceTask.state == '20200406' || maintainanceTask.state == '20200405'">
                                        <span><vc:i18n name="流转" namespace="maintainanceTaskManage"></vc:i18n></span>
                                    </button>
                                    <button class="btn-white btn btn-xs"
                                            v-on:click="_openMaintainanceTaskDetail(maintainanceTask)">
                                        <span><vc:i18n name="详情" namespace="maintainanceTaskManage"></vc:i18n></span>
                                    </button>
                                    <button class="btn-white btn btn-xs" v-if="vc.hasPrivilege('502022031612550001')"
                                            v-on:click="_openDeleteMaintainanceTask(maintainanceTask)">
                                        <span><vc:i18n name="删除" namespace="maintainanceTaskManage"></vc:i18n></span>
                                    </button>
                                </div>
                            </td>
                        </tr>
                        </tbody>
                        <tfoot>
                        <tr>
                            <td colspan="11">
                                <ul class="pagination float-right"></ul>
                            </td>
                        </tr>
                        </tfoot>
                    </table>
                    <!-- 分页 -->
                    <div class="row margin-top-xs">
                        <div class="col-sm-9">
                            <div>
                                保养任务是根据保养计划，自动生成，如果没有生成 请确认是否开启了定时任务(并等待30分钟左右)，或者保养计划是否设置正确
                            </div>
                        </div>
                        <div class="col-sm-3 float-right">
                            <vc:create path="frame/pagination"></vc:create>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <vc:create path="property/maintainanceTaskTransfer"></vc:create>
    
     <vc:create path="property/maintainanceTaskDetail"></vc:create>
     <vc:create path="property/deleteMaintainanceTask"></vc:create>
</div>
